<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Department</title>
<script type="text/javascript">
	function update() {
		var r = confirm("update?");

		return r;
	}
</script>

</head>
<body>
   <a href="javascript:history.back(-1)">返回</a>
	<p>修改部门</p>
	<form action="${pageContext.request.contextPath}/DepartmentServlet"
		method="post">
		<table border="1">
			<tr>
				<td>名称*</td>
				<td><input name="d_name" type="text"
					value="${department.d_name}" required="required" /></td>
			</tr>
			<tr>
				<td>类型*</td>
				<td><select name="d_type" required="required">
						<option value="1"
							<c:if test="${d_type == 1}">selected="selected"</c:if>>部门
							</option>
						<option value="2" 
						    <c:if test="${d_type == 2}">selected="selected"</c:if>>公司
						    </option>
				</select></td>
			</tr>
			<tr>
				<td>电话*</td>
				<td><input name="d_phone" type="text"
					value="${department.d_phone}" required="required" /></td>
			</tr>
			<tr>
				<td>传真</td>
				<td><input name="d_email" type="text"
					value="${department.d_email}" /></td>
			</tr>
			<tr>
				<td>描述</td>
				<td><input name="d_describe" type="text"
					value="${department.d_describe}" /></td>
			</tr>
			<tr>
				<td>上级部门</td>
				<td><input name="d_superiorId" type="number"
					value="<c:if test="${department.d_superiorId != 0}">${department.d_superiorId}</c:if>" /></td>
			</tr>
			<tr>
				<td>成立日期*</td>
				<td><input name="d_startDate" type="date"
					value="${department.d_startDate}" required="required" /></td>
			</tr>
			<tr>
				<td></td>
				<td><input type="submit" onclick="return update()"></td>
			</tr>
		</table>

		<input name="method" type="hidden" value="update" /> <input
			name="d_id" type="hidden" value="${department.d_id}" />
	</form>
</body>
</html>